#ifndef __ADC_H
#define __ADC_H

#include "util.h"

/**
    * @brief YC1051 chip can read the adc pin
    * 
    */
typedef enum{
	ADC_CONFIG_VINLPM = 0,/*!< VINLPM pin */
	ADC_CONFIG_HVIN=1,/*!< HVIN pin */
	ADC_GPIO5 = 0x30,/*!< gengeral gpio[5:7][18:22] */
	ADC_GPIO6 = 0x31,
	ADC_GPIO7 = 0x32,
	ADC_GPIO18 = 0x33,
	ADC_GPIO19 = 0x34,
	ADC_GPIO20 = 0x35,
	ADC_GPIO21 = 0x36,
	ADC_GPIO22 = 0x37,
}AdcType;

/**
    * @brief adc This is a function reference voltage to obtain the voltage value through 
    *	which the current voltage value can be calculated
    */
typedef struct{
	u16_t io_0_5v_data;	/*!<   gengeral gpio  0.5v voltage value*/
	u16_t hvin_1v_data;	/*!<   HVIN pin 1.0v voltage value*/
	u16_t Vinlpm_2v_data;	/*!<   VINLPM pin 2.0 voltage value*/
	u16_t io_1v_data;		/*!<   gengeral gpio  1.0v voltage value*/
	u16_t hvin_5v_data;	/*!<   HVIN pin 5.0v voltage value*/
	u16_t Vinlpm_3v_data;	/*!<   VINLPM pin 3.0v voltage value*/
}Adc_CalibrationVal;


/**
  * @brief it's a function of getting the voltage value
  * @param io_num Represents the IO port that wants to get the voltage value
  * @return 16-bit voltage value what is 100 times the actual voltage value
  */
u16_t YC_get_adc(AdcType  io_num); 

#endif
